#ifndef CPP_DIALOG_H
#define CPP_DIALOG_H
#include <content/DialogInterface.h>

class Context;
class View;

//@brief 对话框
//@author cvte
//@description 提供实现弹出式对话框的接口
class Dialog : public DialogInterface {
   public:
    Dialog();
    Dialog(Context& context);
    virtual ~Dialog();

    void addContentView(View* view);
    void setId(int id) {mId = id;};
    int getId() {return mId;};
    void setTag(long tag) {mTag = tag;};
    long getTag() {return mTag;}

    void create();
    void show();
    void hide();
    void dismiss();

    bool isShowing();
    //@method 设置Dialog是否置顶，如置顶会盖住状态栏，默认置顶
    void setTopmost(bool isTopmost);

   private:
    Context* mContext = nullptr;
    View* mContentView = nullptr;
    bool mIsTopmost = true;
    int mId = 0;
    long mTag = 0;
};

#endif /* CPP_DIALOG_H */